<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <p id="time"></p>
    <script>
        var time = document.getElementById('time');
        function show() {
            var servetime = "2020-11-12 08:34:55";
            var nowTime = new Date().getTime();
            servetime = new Date(servetime).getTime();
            var showTime = nowTime - servetime;

            function msToHMS(ms) {
                // 1- Convert to seconds:
                var seconds = ms / 1000;
                // 2- Extract hours:
                var hours = parseInt(seconds / 3600); // 3,600 seconds in 1 hour
                if(hours<10){
                    hours = "0"+hours
                }
                seconds = seconds % 3600; // seconds remaining after extracting hours
               
                var minutes = parseInt(seconds / 60); // 60 seconds in 1 minute
                if(minutes<10){
                    minutes = "0"+minutes;
                }
                seconds = parseInt(seconds % 60);
                if(seconds<10){
                    seconds = "0"+seconds;
                }
                return hours + ":" + minutes + ":" + seconds
            }
            showTime = msToHMS(showTime)
            console.log(showTime)
            time.innerHTML = showTime;
            setTimeout(show,1000)
        }
        show()    
    </script>
</body>
</html>